package Demo01;
import java.util.Arrays;
public class ArraysDemo01 {
    public static void main(String[] args) throws Exception{
        int data[] = new int[] {1,5,7,2,90,23,56,78};
        System.out.println("【原始数组内容】" + Arrays.toString(data));
        Arrays.sort(data);
        System.out.println("【排序后的数组】" + Arrays.toString(data));
        System.out.println("【数组比较结果】" + Arrays.equals(data,new int[] {1,2,5,7,23,56,78,90}));
        if (Arrays.binarySearch(data, 9) > 0){
            System.out.println("当前数组包含数字7。");
        }
    }
}
